package com.acp.controller;


import com.acp.model.DcsCollectData;
import com.acp.model.DcsData;
import com.acp.model.DcsTime;
import com.acp.model.ObjectManager;
import com.acp.service.DcsCollectDataService;
import com.acp.service.DcsTaskPerfoemanceService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * All rights Reserved, Designed By 姑苏区政府大数据中心
 *
 * @version V1.0
 * @Title: null.java
 * @Package com.dci.controller.construction
 * @Description: 采集小组数据管理
 * @author: 张星亮
 * @date: 2019/4/5
 * @Copyright: 2019 姑苏区政府大数据中心. All rights reserved.
 * 注意：本内容仅限于姑苏区政府大数据中心内部传阅，禁止外泄以及用于其他的商业目
 */

@Controller
@RequestMapping("/data")
public class DcsDataController {

    @Resource
    private DcsTaskPerfoemanceService dcsTaskPerfoemanceService;

    @Resource
    private DcsCollectDataService dcsCollectDataService;

    /**
     * 查询所有信息
     *
     * @return list集合
     */
    @PostMapping("/queryType")
    @ResponseBody
    public List<ObjectManager> queryList(@RequestParam("date")String date) {
        return dcsTaskPerfoemanceService.selectObject(date);
    }

    /**
     * 查询采集数据
     * @param date
     * @return list集合
     */

    @PostMapping("/selectData")
    @ResponseBody
    public List<DcsCollectData> select(@RequestParam("date") String date) {
        return dcsCollectDataService.select(date);
    }

    /**
     * 查询小组的数据
     *
     * @return list集合
     */

    @PostMapping("/selectGroup")
    @ResponseBody
    public List<DcsCollectData> selectGroup(@RequestParam(value = "date",required = false)String date) {
        return dcsCollectDataService.selectAllGroup(date);
    }

    /**
     * 查询小组的分类数据
     *
     * @return list集合
     */

    @PostMapping("/selectByGroupName")
    @ResponseBody
    public List<DcsCollectData> selectByCode(@RequestParam(value = "date",required = false) String date) {
        return dcsCollectDataService.selectAllGroupByCode(date);
    }
}
